import request from "@/utils/request";
export default {
  getUserAll() {
    return request({
      url: "/manage/user/all",
      method: "get",
    });
  },
  getUserList(page, size) {
    return request({
      url: "/manage/user/list",
      method: "post",
      data: {
        page,
        size,
      },
    });
  },
  add(user) {
    return request({
      url: "/manage/user/add",
      method: "post",
      data: user,
    });
  },
  getByid(_id) {
    return request({
      url: `/manage/user/find?_id=${_id}`,
      method: "get",
    });
  },
  update(user) {
    return request({
      url: "/manage/user/update",
      method: "post",
      data: user,
    });
  },
  deleteByid(userId) {
    return request({
      url: "/manage/user/delete",
      method: "post",
      data: {
        userId,
      },
    });
  },
  checkPwd(_id, password) {
    return request({
      url: "/manage/user/pwd",
      method: "post",
      data: {
        _id,
        password,
      },
    });
  },
  updatePwd(userId, password) {
    return request({
      url: "/manage/user/pwd",
      method: "put",
      data: {
        userId,
        password,
      },
    });
  },
};
